Optimal. Leaf size=101 \[ -\frac{3 \cos (e+f x)}{2 f (a-b)^2}+\frac{\cos (e+f x)}{2 f (a-b) \left (a+b \sec ^2(e+f x)-b\right )}-\frac{3 \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 f (a-b)^{5/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0731347, antiderivative size = 101, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3664, 290, 325, 205} \[ -\frac{3 \cos (e+f x)}{2 f (a-b)^2}+\frac{\cos (e+f x)}{2 f (a-b) \left (a+b \sec ^2(e+f x)-b\right )}-\frac{3 \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 f (a-b)^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3664
Rule 290
Rule 325
Rule 205
Rubi steps
\begin{align*} \int \frac{\sin (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{x^2 \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\cos (e+f x)}{2 (a-b) f \left (a-b+b \sec ^2(e+f x)\right )}+\frac{3 \operatorname{Subst}\left (\int \frac{1}{x^2 \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{2 (a-b) f}\\ &=-\frac{3 \cos (e+f x)}{2 (a-b)^2 f}+\frac{\cos (e+f x)}{2 (a-b) f \left (a-b+b \sec ^2(e+f x)\right )}-\frac{(3 b) \operatorname{Subst}\left (\int \frac{1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{2 (a-b)^2 f}\\ &=-\frac{3 \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 (a-b)^{5/2} f}-\frac{3 \cos (e+f x)}{2 (a-b)^2 f}+\frac{\cos (e+f x)}{2 (a-b) f \left (a-b+b \sec ^2(e+f x)\right )}\\ \end{align*}
Mathematica [A] time = 0.764116, size = 146, normalized size = 1.45 \[ \frac{\frac{2 \cos (e+f x) \left (-\frac{b}{(a-b) \cos (2 (e+f x))+a+b}-1\right )}{(a-b)^2}+\frac{3 \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a-b}-\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )}{(a-b)^{5/2}}+\frac{3 \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a-b}+\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )}{(a-b)^{5/2}}}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.067, size = 114, normalized size = 1.1 \begin{align*} -{\frac{\cos \left ( fx+e \right ) }{f \left ({a}^{2}-2\,ab+{b}^{2} \right ) }}-{\frac{b\cos \left ( fx+e \right ) }{2\,f \left ( a-b \right ) ^{2} \left ( a \left ( \cos \left ( fx+e \right ) \right ) ^{2}- \left ( \cos \left ( fx+e \right ) \right ) ^{2}b+b \right ) }}+{\frac{3\,b}{2\,f \left ( a-b \right ) ^{2}}\arctan \left ({ \left ( a-b \right ) \cos \left ( fx+e \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.94515, size = 699, normalized size = 6.92 \begin{align*} \left [-\frac{4 \,{\left (a - b\right )} \cos \left (f x + e\right )^{3} - 3 \,{\left ({\left (a - b\right )} \cos \left (f x + e\right )^{2} + b\right )} \sqrt{-\frac{b}{a - b}} \log \left (\frac{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + 2 \,{\left (a - b\right )} \sqrt{-\frac{b}{a - b}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) + 6 \, b \cos \left (f x + e\right )}{4 \,{\left ({\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} f \cos \left (f x + e\right )^{2} +{\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} f\right )}}, -\frac{2 \,{\left (a - b\right )} \cos \left (f x + e\right )^{3} + 3 \,{\left ({\left (a - b\right )} \cos \left (f x + e\right )^{2} + b\right )} \sqrt{\frac{b}{a - b}} \arctan \left (-\frac{{\left (a - b\right )} \sqrt{\frac{b}{a - b}} \cos \left (f x + e\right )}{b}\right ) + 3 \, b \cos \left (f x + e\right )}{2 \,{\left ({\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} f \cos \left (f x + e\right )^{2} +{\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} f\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.37288, size = 207, normalized size = 2.05 \begin{align*} -\frac{f^{3} \cos \left (f x + e\right )}{a^{2} f^{4} - 2 \, a b f^{4} + b^{2} f^{4}} + \frac{3 \, b \arctan \left (\frac{a \cos \left (f x + e\right ) - b \cos \left (f x + e\right )}{\sqrt{a b - b^{2}}}\right )}{2 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt{a b - b^{2}} f} - \frac{b \cos \left (f x + e\right )}{2 \,{\left (a \cos \left (f x + e\right )^{2} - b \cos \left (f x + e\right )^{2} + b\right )}{\left (a^{2} - 2 \, a b + b^{2}\right )} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]